1 //-------------------------------------------------------------------------------------------------
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //-------------------------------------------------------------------------------------------------
9 class VBRuntimeException
: std::exception
12 VBRuntimeException(const wchar_t * pErrorMessage
) : m_pErrorMessage(pErrorMessage
)
16 const wchar_t * m_pErrorMessage
;
21 #define Assume(condition, description) VSASSERT(condition, description)
23 #define Assume(condition, description) {if (!(condition)) { throw VBRuntimeException(description); }}
26 #define VBFatal(message) throw VBRuntimeException(message)
27 #define ThrowIfFalse(condition) Assume((condition), L"The condition should not be false! \nPLEASE OPEN A BUG. THIS WILL CAUSE A FATAL EXCEPTION IN RETAIL BUILD!")
28 #define ThrowIfFalse2(condition, msg) Assume((condition), WIDE(msg));
29 #define ThrowIfNull(condition) Assume((condition), L"The condition should not be null! \nPLEASE OPEN A BUG. THIS WILL CAUSE A FATAL EXCEPTION IN RETAIL BUILD!")
30 #define ThrowIfTrue(condition) Assume(!(condition), L"The condition should not be true! \nPLEASE OPEN A BUG. THIS WILL CAUSE A FATAL EXCEPTION IN RETAIL BUILD!")